gdk/wayland: Drop emission of emulated scroll events
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 15 Sep 2017 11:20:16 +0000 (13:20 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Tue, 19 Sep 2017 16:39:03 +0000 (18:39 +0200)
A wl_pointer.frame can now only result on one scroll event
being emitted.

gdk/wayland/gdkdevice-wayland.c

index 1bc142a20e26d89357993fb9d1903863a23f5eaf..61a4d50f06c88e7cda929d578a0f097832852f67 100644 (file)
@@ -1387,10 +1387,9 @@ flush_scroll_event (GdkWaylandSeat             *seat,
       pointer_frame->discrete_x = 0;
       pointer_frame->discrete_y = 0;
     }
-
-  if (pointer_frame->is_scroll_stop ||
-      pointer_frame->delta_x != 0 ||
-      pointer_frame->delta_y != 0)
+  else if (pointer_frame->is_scroll_stop ||
+           pointer_frame->delta_x != 0 ||
+           pointer_frame->delta_y != 0)
     {
       /* Axes can stop independently, if we stop on one axis but have a
        * delta on the other, we don't count it as a stop event.
@@ -1404,11 +1403,13 @@ flush_scroll_event (GdkWaylandSeat             *seat,
                                  pointer_frame->delta_x,
                                  pointer_frame->delta_y,
                                  is_stop);
-
-      pointer_frame->delta_x = 0;
-      pointer_frame->delta_y = 0;
-      pointer_frame->is_scroll_stop = FALSE;
     }
+
+  pointer_frame->discrete_x = 0;
+  pointer_frame->discrete_y = 0;
+  pointer_frame->delta_x = 0;
+  pointer_frame->delta_y = 0;
+  pointer_frame->is_scroll_stop = FALSE;
 }
 
 static void